<template>
	<view class="">
		<image src="/static/img/my/bg.png" class="w-max pa top0 left0" style="max-height: 100%;" mode="widthFix" />
		<u-navbar :is-back="false" :border-bottom="false" title="我的" titleBold :is-fixed="false"
			:background="{background:'#0000'}" />
		<view class="pr p30">
			<view class="flex pb20">
				<view class="w108 h108 p4 radius bg-fff">
					<view class="">
						<u-avatar size="100" :src="$user.avatar_img||''"></u-avatar>
					</view>
				</view>
				<view class="fs30 fw-700 pl24">{{$user.name}}</view>
			</view>
			<view class="flex">
				<view class="bg-fff h148 radius12 box-shadow w50p flex"
					@click="$u.route('/pages/my/addPatient/patientList')">
					<image src="/static/img/my/1.png" class="h104 w104" mode=""></image>
					<view class="pl44 ">
						<view class="fs28">
							就诊人
						</view>
						<view class="fs30 fw-600 mt16">{{$user.patient_num||0}}</view>
					</view>
				</view>
				<view class="bg-fff h148 radius12 box-shadow w50p ml20 flex"
					@click="$u.route('/pages/my/coupon/coupon?show=1')">
					<image src="/static/img/my/2.png" class="h104 w104" mode=""></image>
					<view class="pl10">
						<view class="">
							<text class="fs28">优惠券</text>
							<text class="fs24 color-999">(未使用)</text>
						</view>
						<view class="color-fs fw-700 mt16">{{$user.coupon_num||0}}
						</view>
					</view>
				</view>
			</view>
			<view v-for="(item,index) in mylist" :key="index" class=" flex py24 border-b" @click="click(item)">
				<image :src="item.icon" class="h46 w46" mode=""></image>
				<view class="color-666 fs28 pl22 flex1">
					{{item.name}}
				</view>
				<block v-if="item.type=='wx'">
					<view class="color-zs" v-if="$user.is_bind==1">已绑定</view>
					<view class="color-zs" v-else @click="">未绑定</view>
				</block>
				<image src="/static/img/my/right.png" class="h22 w22 ml20" mode=""></image>
			</view>
			<tabbar />
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				scrollTop: 0,
				titleColor: "#232323",
				mylist: [{
						name: '领劵中心',
						icon: '/static/img/my/my_quan.png',
						url: '/pages/my/coupon/coupon?show=0'
					},
					{
						name: '绑定手机号',
						icon: '/static/img/my/my_phone.png',
						url: '/pages/my/bindMobile/bindMobile'
					},
					// {
					// 	name: '绑定微信',
					// 	icon: '/static/img/my/my_bind.png',
					// 	url: '',
					// 	type: 'wx'
					// },
					{
						name: '我的地址',
						icon: '/static/img/my/my_add.png',
						url: '/pages/my/address/address?tit=我的地址'
					},
					{
						name: '帮助中心',
						icon: '/static/img/my/my_help.png',
						url: '/pages/my/menu/help'
						// url: '/pages/my/about/about'
					},
					{
						icon: '/static/img/my/my_contact.png',
						name: '联系平台',
						url: '',
						methods: () => {
							console.log(11);
							this.$showModal('联系平台').then(res => {
								this.$tool.phone(this.$config.shop_mobile)
							})
						},
					},
					{
						name: '设置',
						icon: '/static/img/my/my_set.png',
						url: '/pages/my/set/set'
					},
				],
			};
		},
		onShow() {
			this.$getUser()
		},
		onLoad() {},
		onPageScroll: function(e) {
			this.scrollTop = e.scrollTop
		},
		methods: {
			click(item) {
				item.methods ? item.methods() : this.$u.route(item.url, item.params)
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #fff;
	}
</style>
